<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=0.8, user-scalable=no" />
    <title>WhutDoomCheck</title>
    <base href="/" />
    <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet" />
    <script src="_content/AntDesign/js/ant-design-blazor.js"></script>
    <link href="css/app.css" rel="stylesheet" />
    <link href="WhutDoomCheck.Client.styles.css" rel="stylesheet" />
</head>

<body>
    <div id="app">
        <div style="max-width: 450px; top: calc(50% - 20px); position: absolute; right: 0px; left: 0px; margin: auto;">
            <div class="text-center">
                <div class="spinner-border" role="status"></div>
            </div>
        </div>
    </div>

    <div id="blazor-error-ui">
        页面发生错误，请尝试刷新或重新登录。
        <a href="" class="reload">刷新</a>
        <a class="dismiss">🗙</a>
    </div>
    <script src="_framework/blazor.webassembly.js"></script>
    <script>
        window.downloadFileFromStream = async (fileName, contentStreamReference) => {
            const arrayBuffer = await contentStreamReference.arrayBuffer();
            const blob = new Blob([arrayBuffer]);
            const url = URL.createObjectURL(blob);

            triggerFileDownload(fileName, url);

            URL.revokeObjectURL(url);
        }

        window.triggerFileDownload = (fileName, url) => {
            const anchorElement = document.createElement('a');
            anchorElement.href = url;
            anchorElement.download = fileName ?? '';
            anchorElement.click();
            anchorElement.remove();
        }
    </script>
</body>
</html>
